﻿using System;

namespace ConsolePresentation
{
    public class MainView
    {
        private readonly ITerritoriesView _territoriesView;

        public MainView(ITerritoriesView territoriesView)
        {
            _territoriesView = territoriesView;
        }

        public void Show(string title)
        {
            Console.WriteLine("   " + title + "   ");
            Console.WriteLine("   1. Show Territories");
            Console.WriteLine("   2. Show Regions");
            //Console.WriteLine("   3. Add Region");
            Console.Write("   Input:");
            string userChoice = Console.ReadLine();

            switch (userChoice)
            {
                case "1":
                    _territoriesView.ShowTerritories();
                    break;
                case "2":
                    Console.Write("Regions with Territories (Y/N):");
                    string userChoiceRegion = Console.ReadLine();
                    switch (userChoiceRegion)
                    {
                        case "Y":
                        case "y":
                            _territoriesView.ShowRegions(true);
                            break;
                        case "N":
                        case "n":

                            _territoriesView.ShowRegions(false);
                            break;
                        default:
                            _territoriesView.ShowRegions(true);
                            break;
                    }
                    break;
                default:
                    _territoriesView.ShowTerritories();
                    Console.WriteLine("Default ");
                    Console.WriteLine("");
                    break;
            }
        }
    }
}